package pack0817;

public class DemoA {
    private String title;
    private int pageNum;
    public void setTitle(String title){
        this.title=title;
    }

    public String getTitle() {
        return title;
    }

    public void setPageNum(int pageNum) {
        if(pageNum>=200){
            this.pageNum = pageNum;
        }else {
            System.out.println("错误信息");
            this.pageNum = 200;
        }
    }

    public int getPageNum() {
        return pageNum;
    }
    public void detail(){
        getTitle();
        getPageNum();
        System.out.println(title);
        System.out.println(pageNum);
    }

    public static void main(String[] args) {
        DemoA bd = new DemoA();
        bd.setTitle("中华字典");
        bd.setPageNum(199);
        bd.detail();
    }
}
